//package com.lzp.config;
//
//import com.lzp.common.CommonFileItemReader;
//import com.lzp.common.CommonFileItemWriter;
//import com.lzp.entity.People;
//import com.lzp.entity.Student;
//import com.lzp.processor.StudentProcessor;
//import org.springframework.batch.core.Job;
//import org.springframework.batch.core.Step;
//import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
//import org.springframework.batch.core.configuration.annotation.JobBuilderFactory;
//import org.springframework.batch.core.configuration.annotation.StepBuilderFactory;
//import org.springframework.batch.core.configuration.annotation.StepScope;
//import org.springframework.batch.core.job.flow.Flow;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
///**
// * @author shuliangzhao
// * @Title: UserConfiguration
// * @ProjectName spring-boot-learn
// * @Description: TODO
// * @date 2019/9/7 17:06
// */
//@Configuration
//@EnableBatchProcessing
//public class StudentConfiguration {
//
//    @Autowired
//    private JobBuilderFactory jobBuilderFactory;
//
//    @Autowired
//    private StepBuilderFactory stepBuilderFactory;
//
//    @Autowired
//    private StudentProcessor studentProcessor;
//
//    @Bean
//    public Job studentJob() {
//         return jobBuilderFactory.get("studentJob")
//                 .start(studentStep())
//                 .build();
//    }
//    @Bean
//    public Job billJob() {
//        return jobBuilderFactory.get("billJob").start(billStep()).build();
//    }
//
//    private Step billStep() {
//        return stepBuilderFactory.get("billStep")
//                .chunk(10)
//                .reader(billItemReader())
//                .processor(bill);
//    }
//
//    @Bean
//    public Step studentStep() {
//        return stepBuilderFactory.get("studentStep")
//                .<People, Student>chunk(10)
//                .reader(peopleCommonFileItemReader())
//                .processor(studentProcessor)
//                .writer(studentCommonFileItemWriter())
//                .build();
//    }
//
//    @Bean
//    @StepScope
//    public CommonFileItemReader<People> peopleCommonFileItemReader() {
//        return new CommonFileItemReader<>(People.class);
//    }
//
//
//    public CommonFileItemWriter<Student> studentCommonFileItemWriter() {
//        return new CommonFileItemWriter<>(Student.class);
//    }
//}